/**
 * 
 */

function openImageWin(str) {  
   window.open (str, new Date().valueOf(), "width=980,height=560,toolbar=no,addressbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no")  
}

/**
 * 弹出页面选择
 * @param url
 */
function openPupWindow(url) {
    window.open(appServer+url, 'newwindow', 'height=400, width=1000, top=20,left=150, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no').focus();
}


function num(obj){
    obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
    obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
    obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
    obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
    obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
    if(parseFloat(obj.value)>100){
        obj.value = 100;
    }
}
function checkvalue(obj){
    obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
    obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
    obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
    obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
    obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
}

function onlyNum(obj) {
    obj.value = obj.value.replace(/[^\d]/g,""); //清除"数字"和"."以外的字符
    obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
}